package com.atguigu.gulimall.feign.seckill;

import com.atguigu.gmall.common.result.Result;
import com.atguigu.gulimall.order.entity.OrderInfo;
import com.atguigu.gulimall.seckill.entity.SeckillGoods;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;

import java.util.List;

/**
 * @author nicc
 * @version 1.0
 * @className SeckillFeignClient
 * @date 2022-10-28 11:13
 */
@RequestMapping("/api/inner/seckill")
@FeignClient("service-seckill")
public interface SeckillFeignClient {

    /**
     * 获取秒杀单
     * @param skuId
     * @return
     */
    @GetMapping("/order/{skuId}")
    public Result<OrderInfo> getSeckillOrder(@PathVariable("skuId") Long skuId);

    /**
     * 获取今天参与秒杀的所有商品
     * @return
     */
    @GetMapping("/goods/list/today")
    Result<List<SeckillGoods>> getCurrentDaySeckillGoods();


    /**
     * 秒杀商品详情数据
     * @param skuId
     * @return
     */
    @GetMapping("/goods/detail/{skuId}")
    Result<SeckillGoods> getDetail(@PathVariable("skuId") Long skuId);

}
